<template>
  <div class="housecilities">
    <detailIntroduce title="房屋设施" view="查看全部设施">
      <div class="content">
        <template
          v-for="(item, index) in housecilities?.houseFacilitys"
          :key="item"
        >
          <div class="item" v-if="housecilities.facilitySort?.includes(index)">
            <div class="left">
              <img :src="item.icon" alt="" />
              <span class="text">{{ item.groupName }}</span>
            </div>
            <div class="right">
              <template
                v-for="(item1, index1) in item.facilitys.slice(0, 4)"
                :key="item1"
              >
                <div class="right-item">
                  <van-icon name="certificate" />
                  <span class="text">{{ item1.name }}</span>
                </div>
              </template>
            </div>
          </div>
        </template>
      </div>
    </detailIntroduce>
  </div>
</template>

<script setup>
import detailIntroduce from "@/components/detail-house-introduce/detail-introduce.vue"

const props = defineProps({
  housecilities: {
    type: Object,
    default: () => ({}),
  },
})
</script>

<style lang="less" scoped>
.housecilities {
  padding: 8px;
  border-bottom: 10px solid #eee;
  .content {
    padding: 3px 7px;
    border: 1px solid #fff;
    border-radius: 5px;
    display: flex;
    flex-wrap: wrap;
    // justify-content: center;
    background-color: rgb(243, 247, 252);
    .item {
      width: 100%;
      // background-color: yellow;
      display: flex;
      justify-content: center;
      margin-top: 15px;
      .left {
        // background-color: blue;
        width: 30%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        img {
          width: 30%;
          margin: 0 auto;
        }
        .text {
          margin-top: 4px;
          text-align: center;
          font-size: 6px;
          text-shadow: 0.3px 0.3px #333;
        }
      }
      .right {
        display: flex;
        flex-wrap: wrap;
        width: 70%;
        margin-left: 10px;
        .right-item {
          width: 50%;
          display: flex;
          // justify-content: center;
          align-items: center;
          flex-wrap: wrap;
          .text {
            font-size: 1px;
            text-shadow: 0.3px 0.3px #333;
          }
          .van-icon {
            margin-right: 4px;
            color: rgb(179, 234, 215);
          }
        }
      }
    }
  }
}
</style>
